#include <iostream>
#include <cstdio>

using namespace std;

int s;
char f;
int main()
{
    cin >> s >> f;
    int i = 1;   //每层数量
    int sum = 1; //消耗总数
    int c = 0;   //层数
    while (true)
    {
        if (sum + (2 * i) > s)
        {
            break;
        }
        sum += 2 * i;
        i += 2;
        c += 1;
    }
    //上
    int p = 0;
    for (int j = 1; j <= c; j++)
    {
        for (int t = 0; t < p; t++)
        {
            cout << " ";
        }
        for (int k = 1; k <= i - 2 * p; k++)
        {
            cout << f;
        }
        p += 1;
        cout << endl;
    }
    cout << "  " << f << endl;
    //下
    for (int j = 1; j <= c; j++)
    {
        for (int t = p; t > 0; t--)
        {
            cout << " ";
        }
        for (int k = i - 2 * p; k >= 1; k--)
        {
            cout << f;
        }
        p -= 1;
        cout << endl;
    }
    cout << s - sum;
}

// 0 6 16 30 48
// 1 3 5 7 9